<template>
  <div class="app">
    <h2 class="title">Vue路由测试</h2>
    


    <nav class = "navigate">
        <RouterLink to="/home" active-class="active" >首页</RouterLink>
        <RouterLink :to="{name:'news'}" active-class="active" >新闻</RouterLink>
        <RouterLink :to="{path:'/about'}" active-class="active" >关于</RouterLink>
    </nav>


    <section class="main-content">
      <RouterView></RouterView>
    </section>
    
    <Count></Count>
     <LoveTalk></LoveTalk>
  </div>
</template>

<script lang="ts" setup>
  import { RouterView ,RouterLink} from 'vue-router';
  import Count from './components/Count.vue';
  import LoveTalk from './components/LoveTalk.vue';
  import { ElButton } from 'element-plus';
  import { computed } from 'vue';


</script>

<style scoped>
.title{
  height: 100px;
  /* 灰色白色渐变 */
  background: linear-gradient(90deg, #808080, #ffffff);
  border-radius: 20px;
  text-align: center;
  line-height: 100px;
  border: 1px solid #000;
}

.navigate{
  display: flex;
  justify-content: space-around;
}

.navigate a{
  display: block;
  width: 100px;
  background-color: gray;
  height: 40px;
  line-height: 40px;
  text-align: center;
  color: #fff;
  text-decoration: none;
  border-radius: 15px;
  font-weight:bolder;
}

.navigate a.active{
  background-color: green;
  color: orange;
} 

.main-content{
  border: 1px solid #000;
  height: 500px;
  margin: 20px;
  border-radius: 15px;
}

.theme-switcher {
  margin: 10px 0;
  text-align: center;
}
</style>